home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Cream of the Crop 3
/
Cream of the Crop 3.iso
/
pascal
/
bp7_os2.zip
/
BP7-OS2.DOC
next >
Wrap
Text File
|
1993-11-10
|
8KB
|
224 lines
DOCUMENTATION FOR BP7.x OS/2 PATCH
----------------------------------
Borland has for a while offered a C++ compiler for OS/2, but Pascal people
still have to go on waiting. With some minor alterationt to the compiler,
units and the runtime library, you can now create 16-bit OS/2 programs for
the OS/2 text modes and Presentation Manager. The German computer magazine
c't has provided these patches for BP7.x
After applying the patches, you can now compile your DOS programs for
OS/2. In most cases compiling for a DOS or OS/2 platform is just a matter
of a command line switch, or changing the "Target" in the patched IDE.
The batch file "INSTALL.BAT" applies the patches to *copies* of your
BP7.0 compiler and IDE (i.e., the original files are untouched).
Fuller details as to how to apply the patches can be found below.
I am currently trying to gather information about the OS/2 API calls, for
the purpose of producing UNIT files to interface to the OS/2 API. Some of
the API calls can already be found in the sources for the new DOS, CRT,
and SYSTEM units. When I am able to gather sufficient information, I will
upload the results to ftp-os2.cdrom.com and garbo.uwasa.fi. Note that this
may take months.
The files in this package are:
------------------------------
BP7-OS2.DOC This file
INSTALL.BAT Copies the original files and makes the patches
PATCHBP.PAS Patches the compilers
COMPATIB.PAS Unit which provides DOS interrupt compatibility
CRT.PAS OS/2 port of the CRT unit
DOS.PAS OS/2 port of the DOS unit
MAKEPM.PAS Sets the flags for PM programs
HELLO2.PAS Writes "Hello, world"
HELLOPM.PAS "Hello, world!" in a PM application
HELLOPM.RC Resource file for HELLOPM.PAS
THREAD.PAS Demonstration for Threads
VIDEO.PAS Direct video access unit
OS2RTL.EXE Creates the OS/2 runtime library in OS2RTL\
INSTALLATION PROCEDURE
----------------------
When I installed the patches, I did not have a lot of guidance, and
I was using the German language version. I sorted things out by trial
and error. I later received the original English language version
from someone whose name I have forgotten, and all I have done is to
amend one or two things in it, and to provide this documentation).
I have reduced all that I did into a number of steps. They may
seem many, but they are actually quite straightforward.
In order to apply the patch, take the following steps;
1. Make sure that the following executables are in your PATH statement
so that they can be called by the patch routines;
a. BPC.EXE
b. TASM.EXE
c. MAKE.EXE
2. Create a directory for your patched files, from where you will
be running the OS/2 patches. It is important to make this decision
before you start anything, as it will make things go a lot
easier. I will refer to this directory from now on as "your
BP-OS2 directory".
3. Change to your BP-OS2 directory, and UNZIP the file BP7-OS2.ZIP
into this directory.
4. The batch file INSTALL.BAT assumes that your BP7.x binaries are
in a directory called \BP\BIN on the current drive. If they are
not, you need to edit this file to change all the references to
\BP\BIN to the correct directory paths.
5. If you are using BP7.0, type "INSTALL"
If you are using BP7.01, type "INSTALL 701"
This will run the batch file that will copy the files;
BP.EXE
BPC.EXE
into the current directory.
They will be called
BPOS2.EXE
BPCOS2.EXE respectively
Then it will compile PATCHBP.EXE, and apply it to the EXE files that
have been copied.
What the patch does is;
a. To add a new command line parameter "-CO" to your new
BPCOS2.EXE, to compile for an OS/2 platform. You can
still use the patched executable to compile for a DOS
platform by using the "-CD" parameter, and for DPMI, by
using the "-CP" parameter.
b. The unit files produced when you compile a unit for OS/2
will have the extension "TPO".
c. In the new BPOS2 IDE, there will be a new target platform
(OS/2). This replaces "Windows" in the IDE.
d. The default TPL file for OS/2 compilation is now
OS2.TPL
That's about it really.
6. Type "OS2RTL" - to extract the OS/2 run-time library files. This
creates a sub-directory called "OS2RTL" in the directory in which
you are operating, and further sub-directories called "INC", "LIB"
and "SYS" in that "OS2RTL" directory. The run-time files are
extracted into these directories.
7. Change into the OS2RTL subdirectory.
8. Edit the file "MAKEFILE". You should change the line
"BP = \OS2"
to your BP-OS2 directory (e.g., BP = C:\BP\OS2)
9. Type "MAKE" - this will run MAKE.EXE, which will call TASM.EXE to
compile the assembly language source files that are needed to create
the SYSTEM UNIT.
10. After MAKE has finished, there will be a file called "OS2.TPL".
Copy this into your BP-OS2 directory.
11. Change to your BP-OS2 directory, and compile the following source
files for OS/2 compatibility;
a. COMPATIB.PAS
b. DOS.PAS
c. CRT.PAS
i.e., you will type
BPCOS2 -CO COMPATIB
BPCOS2 -CO DOS
BPCOS2 -CO CRT
This will produce the unit files;
COMPATIB.TPO
DOS.TPO and
CRT.TPO.
With the new SYSTEM.TPO, you now have all you need to compile 16-bit OS/2
programs.
That's all, folks!
You can compile the example programs to see the results of your efforts.
The patches (BPOS2.EXE and BPCOS2.EXE) can actually be copied
into your BP7 directory. They will read the same .CFG, .TP, and
.DLL files as the unpatched versions. There will be no clash here,
because the units they produce and use have an extension .TPO
However, if you have installed your sources for BP7, you have
to be careful not to overwrite them with the OS/2 versions of
SYSTEM.PAS, DOS.PAS and CRT.PAS. Thus it may be better to keep
the patched EXEs in a separate directory.
The only things being duplicated in the whole system are the two
patched executables and their source code. All the other binaries
are shared with the unpatched versions.
THE EXAMPLE PROGRAMS
--------------------
1. HELLO2.PAS - this is a text-mode "hello" program. All you need is
to compile this, and run it. If you run it from a DOS prompt, you
will get the message "This program requires OS/2" - it is a sign
that you are well and truly home.
2. HELLOPM.PAS - this is a Presentation Manager "hello" program -
complete with menus, dialog boxes, etc.
In order to compile and run the HELLOPM program and any other PM
program, you need to take the following steps;
a. Compile MAKEPM.PAS as either a DOS or OS/2 program
b. Compile your PM program
c. Run MAKEPM on your PM program
e.g. "MAKEPM PMPROG.EXE"
d. Run the OS/2 RC.EXE on your PM program and its resource file.
RC.EXE comes with the OS/2 operating system.
e.g. "RC HELLOPM.RC HELLOPM.EXE"
NOTE: You may have to run RC from an OS/2 command prompt.
Running it from a DOS prompt produces an error message.
e. Run your OS/2 PM program!
DISCLAIMER
----------
I AM ONLY SUPPLYING THIS PATCH BECAUSE MANY PEOPLE HAVE ASKED FOR IT.
I NEITHER WROTE IT, NOR AM I RESPONSIBLE FOR ITS USE. YOU USE THIS
PATCH ENTIRELY AT YOUR OWN RISK. I WILL ACCEPT NO RESPONSIBILITY
FOR ANY LOSS OR DAMAGE, WHETHER FINANCIAL, PHYSICAL, MENTAL,
EMOTIONAL, MARITAL, SOCIAL, PROFESSIONAL, OR OTHERWISE, THAT MAY ARISE FROM
THE USE OR THE PURPORTED USE OF THIS PATCH FOR ANY PURPOSE WHATSOEVER.
SO LET IT BE WRITTEN, SO LET IT BE DONE.
-------------------------------------
Dr. A. Olowofoyeku
Keele University
England.
E-mail: laa12@seq1.keele.ac.uk
--------------------------------------